/*
 * King.cpp
 *
 *  Created on: Mar 30, 2011
 *      Author: cnwilson
 */
#include "../inc/King.h"

King::King(Color _color,Position _pos): Piece(_color,_pos,KING){

}

vector<Position> King::getPotentialMoves(){
	vector<Position> moves,temp;
	temp.push_back(pos+Position( 1,-1));
	temp.push_back(pos+Position( 1, 0));
	temp.push_back(pos+Position( 1, 1));
	temp.push_back(pos+Position( 0,-1));
	temp.push_back(pos+Position( 0, 1));
	temp.push_back(pos+Position(-1,-1));
	temp.push_back(pos+Position(-1, 0));
	temp.push_back(pos+Position(-1, 1));

	for(int i=0; i<temp.size();i++)
		if(temp[i]>=0 && temp[i]<BOARDSIZE)
			moves.push_back(temp[i]);

	return moves;
}
